home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / librarie / tskmng.sit / Task Manager Folder / Task Manager Source / Task.h < prev   
Encoding:
C/C++ Source or Header  |  1992-05-01  |  1.6 KB  |  60 lines

  1. /*
  2.         Task Manager -- Background processing support
  3.         version 2.2.1
  4.  
  5.     This software source package is Copyright ⌐ 1990-91 by Michael Hecht. All Rights
  6.     Reserved. It may be freely distributed in source or object code format; however,
  7.     the source code may not be sold for profit or charged for in any way. The source
  8.     code must be distributed as a package including all H files, sample code and
  9.     projects, and documentation.
  10.  
  11.     I welcome any comments or suggestions that will help me improve or extend the
  12.     functionality of the Task Manager. You can reach me at:
  13.  
  14.         Internet:        Michael_Hecht@mac.sas.com
  15.         AppleLink:        SAS.HECHT
  16.  
  17.     Happy Tasking!
  18.  
  19.  
  20.     --Michael Hecht
  21.  */
  22.  
  23. /* Don't re-include */
  24. #pragma once
  25.  
  26. /* For compatibility with previous release */
  27. #define TaskIdle        TaskYield
  28.  
  29. /* Define the following macro as 1 to include stack checking code */
  30. /* Define the following macro as 0 to remove stack checking code */
  31. #define TASK_DEBUG        1
  32.  
  33. /* Default options */
  34. #define kDefaultWakeTime            60            /* One second    */
  35.  
  36. /* Task procedure */
  37. typedef void ( *TaskProcPtr )( long taskRefCon );
  38.  
  39. /* Routines */
  40. OSErr InitTasking( void );
  41. OSErr TermTasking( void );
  42.  
  43. /* Creating tasks */
  44. OSErr NewTask( TaskProcPtr taskProc, TaskProcPtr taskTermProc,
  45.                 long taskRefCon, short *taskRefNum );
  46. OSErr DisposeTask( short taskRefNum );
  47.  
  48. /* Running tasks */
  49. OSErr RunTasks( unsigned long wakeTime );
  50. OSErr TaskYield( void );
  51.  
  52. /* Getting task info */
  53. short CurrentTask( void );
  54. short CountTasks( void );
  55. short GetIndTask( short index );
  56.  
  57. /* Task reference constant */
  58. long GetTaskRefCon( short taskRefNum );
  59. OSErr SetTaskRefCon( short taskRefNum, long taskRefCon );
  60.